rm(list = ls())

## packages 

library(tidyverse)
library(fixest)

## Load data 

dat <- readRDS('data/civey_clean.rds') 

## Table 1

feols(vote_afd ~ treated_post_placebo | user_id + date, 
            data = dat %>% filter(freibad_in_zip == 0),
            fsplit = ~ foreign_non_eu_share_bin, 
            cluster = ~ user_id) %>%
  etable()

## Table 2

feols(vote_afd ~ treated_post | user_id + date, 
            data = dat,
            fsplit = ~ foreign_non_eu_share_bin, 
            cluster = ~ user_id) %>%
  etable()

